package com.systop.common.modules.area.webapp;

import java.util.List;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.systop.common.modules.area.model.Area;
import com.systop.common.modules.area.service.AreaManager;
import com.systop.core.webapp.struts2.action.JsonCrudAction;

@SuppressWarnings({ "rawtypes", "serial" })
@Controller
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class AreaAction extends JsonCrudAction<Area, AreaManager> {
	
	private List areas;
	private String parentCode;
	
	public String areasJson(){
		
		areas = getManager().getAreas(parentCode);
		return JSON;
	}

	public List getAreas() {
		return areas;
	}

	public String getParentCode() {
		return parentCode;
	}

	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}
}
